<div class="course-list">
  <div class="row">
    {% for course in courses %}
      {% set courseSet = data('CourseSet', { id: course.courseSetId }) %}
      <div class="col-lg-3 col-md-4 col-xs-6">
        <div class="course-item">
          <div class="course-img">
            <a href="{{ path('course_show', {id: courseSet.defaultCourseId}) }}" target="_blank">
              {% if courseSet.discountId > 0 %}
                {% if courseSet.discount == 0 %}
                  <!-- 限免 -->
                  <span class="tag-discount free"></span>
                {% else %}
                  <!-- 折扣 -->
                  <span class="tag-discount"></span>
                {% endif %}
              {% endif %}
              {% if courseSet.serializeMode == constant('Biz\\Course\\Service\\CourseSetService::SERIALIZE_SERIALIZE_MODE') %}
                <span class="tags"><span class="tag-serialing"></span></span>
              {% elseif courseSet.serializeMode == constant('Biz\\Course\\Service\\CourseSetService::FINISH_SERIALIZE_MODE') %}
                <span class="tags"><span class="tag-finished"></span></span>
              {% endif %}
              {% if courseSet.type == 'live' %}
                <span class="tags">
                  <span class="tag-live"></span>
                </span>
              {% endif %}
              <img class="img-responsive" src="{{ filepath(course_set_cover(courseSet, 'middle'), 'courseSet.png') }}" alt="{{ course.title }}">
            </a>
          </div>
          <div class="course-info">
            <div class="title">
              <a class="link-dark" href="{{ path('course_show', {id:course.id}) }}" target="_blank">
                {{ course.title }}
              </a>
            </div>
            <div class="metas clearfix">
              {% if setting('course.show_student_num_enabled', '1') == 1  %}
                <span class="num">
                  {% if setting('course.show_cover_num_mode') == 'studentNum' %}
                    <i class="es-icon es-icon-people"></i>{{ courseSet.studentNum }}
                  {% elseif setting('course.show_cover_num_mode') == 'hitNum' %}
                    <i class="es-icon es-icon-view"></i>{{ courseSet.hitNum }}
                  {% endif %}
                </span>
              {% endif %}
              <span {% if setting('course.show_student_num_enabled', '1') == 1 %} class="comment" {% endif %}><i class="es-icon es-icon-textsms"></i>{{ course.ratingNum }}</span>
              {% include 'course/widgets/price.html.twig' with {shows:'price'} %}
            </div>
          </div>
        </div>
      </div>
    {% endfor %}
  </div>
</div>
